﻿/*
 * Created by SharpDevelop.
 * User: Corrado Mio
 * Date: 13/06/2012
 * Time: 13:36
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.IO;

namespace CSharpExt.Util
{
    /// <summary>
    /// Description of NETUtils.
    /// </summary>
    public static class NETUtils
    {
        #region Properties
        
        public static String FrameworkDirectory
        {
            get { return Path.GetDirectoryName(typeof(Environment).Assembly.Location); }
            
//            get 
//            {
//                String directory = Environment.GetFolderPath(Environment.SpecialFolder.Windows);
//                Version version = Environment.Version;
//
//                if(Environment.Is64BitProcess)
//                {
//                    directory = Path.Combine(directory, "Microsoft.NET\\Framework64");
//                }
//                else
//                {
//                    directory = Path.Combine(directory, "Microsoft.NET\\Framework");
//                }
//                
//                if (version.Major == 3)
//                {
//                    directory = Path.Combine(directory, String.Format("v{0}.{1}", version.Major, version.Minor));
//                }
//                else
//                {
//                    directory = Path.Combine(directory, String.Format("v{0}.{1}.{2}", version.Major, version.Minor, version.Build));
//                }
//                
//                if (!Directory.Exists(directory))
//                    throw new IOException("Unable to retrieve .NET Framework installation directory");
//                
//                return directory;
//            }
        }
        
        #endregion
    }
}
